package com.hsgene.common.util.exception;

/**
 * 公共错误码定义（code：1 - 100）.
 *
 * @author wangbing
 * @version 1.0, 2018/7/5
 */
public enum CommonErrorCode implements ErrorCode {

    /**
     * 缺少必需的参数
     */
    REQUIRED_PARAM(1, "Error_Common_Required_Param", "缺少必需的参数"),

    /**
     * 不合法的参数
     */
    ILLEGAL_PARAM(2, "Error_Common_Illegal_Param", "不合法的参数"),

    /**
     * 验证不通过
     */
    VALIDATION_FAILED(3, "Error_Common_Validation_Failed", "验证不通过"),

    /**
     * 手机号码格式错误
     */
    PHONE_INVALIDATION_FORMAT(4, "Error_Common_Invalidation_Format", "手机号码格式错误"),

    /**
     * 文件为空
     */
    FILE_IS_EMPTY(5, "file_is_empty", "文件为空"),

    /**
     * 文件大小超过限制
     */
    FILE_SIZE_EXCEEDS_LIMIT(6, "file_size_exceeds_limit", "文件大小超过限制"),

    /**
     * 文件类型错误
     */
    WRONG_FILE_FORMAT(7, "wrong_file_format", "文件类型错误"),

    /**
     * 网关异常
     */
    GATEWAY_SERVICE_EXCEPTION(9, "Error_Gateway", "网关异常"),

    /**
     * 服务不可用
     */
    SERVICE_NOT_AVAILABLE(10, "service_not_available", "服务不可用"),

    /**
     * 权限服务不可用
     */
    AUTHORITY_SERVICE_NOT_AVAILABLE(20, "authority_service_not_available", "权限服务不可用"),

    /**
     * 套餐商品服务不可用
     */
    PRODUCT_SERVICE_NOT_AVAILABLE(21, "product_service_not_available", "套餐商品服务不可用"),

    REQUIRED_NUMBER_TYPE(22, "REQUIRED_NUMBER_TYPE", "缺少编号类型"),

    ORDER_SERVICE_NOT_AVAILABLE(23, "order_service_not_available", "订单服务不可用"),

    DISCOUNT_SERVICE_NOT_AVAILABLE(24, "discount_service_not_available", "优惠折扣服务不可用"),

    AUTHORIZATION_PARSE_EXCEPTION(25, "Authorization_Parse_Exception", "Authorization-Token解析异常"),

    CLIENT_TYPE_EXCEPTION_NOT_SUPPORTED(26, "Client_Type_Exception_Not_Supported", "客户端类型异常：不支持的客户端类型"),

    GENERATOR_SERVICE_NOT_AVAILABLE(27, "generator_service_not_available", "ID生成器服务不可用"),

    SECURITY_SERVICE_NOT_AVAILABLE(28, "security_service_not_available", "加密解密服务不可用"),

    DICT_SERVICE_NOT_AVAILABLE(29, "dict_service_not_available", "字典服务不可用"),

    /**
     * 用户服务不可用
     */
    USER_SERVICE_NOT_AVAILABLE(30, "user_service_not_available", "用户服务不可用"),

    /**
     * 商品服务不可用
     */
    GOODS_SERVICE_NOT_AVAILABLE(31, "goods_service_not_available", "商品服务不可用"),

    LOGISTICS_SERVICE_NOT_AVAILABLE(32, "logistics_service_not_available", "物流服务不可用"),

    SAMPLE_SERVICE_NOT_AVAILABLE(33, "sample_service_not_available", "样本服务不可用"),

    SUPPLIER_SERVICE_NOT_AVAILABLE(34, "supplier_service_not_available", "检测机构服务不可用"),

    CONSUMABLES_SERVICE_NOT_AVAILABLE(35, "consumables_service_not_available", "耗材服务不可用"),

    MEDICINE_SERVICE_NOT_AVAILABLE(36, "medicine_service_not_available", "药品服务不可用"),

    MESSAGE_SERVICE_NOT_AVAILABLE(37, "message_service_not_available", "消息服务不可用"),

    MQ_SERVICE_NOT_AVAILABLE(39, "MQ_SERVICE_NOT_AVAILABLE", "消息队列服务不可用"),

    PAY_SERVICE_NOT_AVAILABLE(38, "pay_service_not_available", "支付服务不可用"),

    VERSION_SERVICE_NOT_AVAILABLE(39, "VERSION_SERVICE_NOT_AVAILABLE", "版本管理服务不可用"),

    FIRST_LOGIN_VERIFY(10037, "Error_Users_First_Login_Verify", "首次登录必须重置密码");

    private final int code;

    private final String message;

    private final String description;

    CommonErrorCode(final int code, final String message, final String description) {
        this.code = code;
        this.message = message;
        this.description = description;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public String getDescription() {
        return description;
    }
}
